# -*- coding: utf-8 -*-
# @Time    : 2023/6/5 9:56
# @Author  : lxy
# @Email   : 1612393119@qq.com
# @File    : course_search_list_page.py
# @Software: PyCharm
from pages.base_page import BasePage
from appium.webdriver.common.mobileby import MobileBy as By

class CourseSearchListPage(BasePage):
    # 搜索课程列表页面
    search_text_locator = (By.ANDROID_UIAUTOMATOR,'new UiSelector().className(\"android.widget.EditText\").textContains(\"搜索课程\").resourceId(\"com.xiachufang:id/search_edit_text\")')
    search_btn_locator=(By.XPATH,'//android.widget.TextView[@text=\"搜索\"]')
    search_content_locator=(By.XPATH,'//android.view.View[@text=\"私房红烧牛肉面\"]')

    # 在输入框输入搜索内容
    # def search_input(self):
    #     self.find_element(self.search_text_locator).click()
    def search_text(self,search_content):
        self.find_element(self.search_text_locator).send_keys(search_content)
    # 点击搜索按钮
    def search_btn(self):
        self.find_element(self.search_btn_locator).click()
    # 获取搜索内容文本
    def search_content(self):
        contain_text=self.find_element(self.search_content_locator).text
        return contain_text
